<template>
	<view>
		<button @click="callsetstorge()">setstorage</button>
		<button @click="callgetstorage()">获取缓存</button>
		<button @click="callstoinfo()">console.info</button>
		<button @click="callmove()" type="warn">删除</button>
		<button @click="callclear()" type="warn">清空</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			onfuncall(){
				name=uni.getStorageSync("username");
				pwd="sssss";
			},
			callsetstorge(){
				uni.setStorage({
					key:"username",
					data:"zyq",
					success() {
						console.log("存储username 成功回调");
					},
					fail() {
						console.error("存储username 成功失败")
					}
				})
			},
			callgetstorage(){
				uni.getStorage({
					key:"account",
					success :function(result) {
						console.log("获取本地缓存成功 成功回调"+result.data);
					},
					fail:function(e) {
						console.error("获取本地缓存失败："+JSON.stringify(e));
						console.error("获取本地缓存失败："+e.errmsg);
					},
				})
			},
			callstoinfo(){
				console.log("callstoinfo-->");
				uni.getStorageInfo({
					success:function(result) {
						console.log("callstoinfo-->"+result.keys);
						console.log("callstoinfo-->"+result.currentSize);
					}
				})
			},
			
		}
	}
</script>

<style>

</style>
